In computer-related technologies, an event listener is an element that detects (“listens” for) an occurrence of an event of a specified type or types in a software object (hereinafter referred to as “object”) and notifies a subscriber of the occurrence of the event. In a hierarchical data structure having objects at different levels of hierarchy, to detect an occurrence of an event in any of the objects (such as creation of an object, deletion of an object, or modification of an object), current event listener techniques register an event listener on each of the objects in the hierarchical data structure. These techniques typically consume a significant amount of time and memory in registering event listeners.
Consider a scenario, for example, in which a social networking environment has 100,000 users (clients) and a server containing 100 million objects organized in a hierarchical data structure representing some user information. Assume that registering an event listener on an object consumes one bit of memory. If there are 100,000 clients, and each of the 100,000 clients wants to place an event listener on each of the 100 million objects on the server, 1.25 Terabytes of memory may be consumed just for registration of the event listeners. Three types of event listeners may be registered on an object—(a) creation of an object, (b) modification an object and (c) a child of an object. Therefore, 3.75 Terabytes of memory may be consumed just for registration of the event listeners. Further, if the client sends a separate registration request for each of the objects in the hierarchy, a significant amount network bandwidth and time may be consumed for registration. The current event listener techniques are typically inefficient, at least with respect to a consumption of time, memory and network bandwidth. Furthermore, the inefficiencies associated with current techniques of registering the event listeners may significantly scale up as the number of clients, the number of objects in the hierarchy, or both increase. In distributed system architecture, new distributed applications or services and new clients that want to consume the services may increase continuously. In such a distributed environment, the current techniques for registering event listeners would typically reduce significantly the efficiency of the whole system by consuming a significant amount of resources for registration of event listeners.